#include <stdio.h>
#include <string.h>

int main (int argc, char *argv[])
{
  if (strcasecmp(argv[1], "LEON") == 0)
  {
    system("/usr/local/sbin/domotica -e 1");
  }

  else if (strcasecmp(argv[1], "LEOFF") == 0)
  {
    system("/usr/local/sbin/domotica -a 1");
  }

  else if (strcasecmp(argv[1], "TRON") == 0)
  {
    system("/usr/local/sbin/domotica -e 2");
  }

  else if (strcasecmp(argv[1], "TROFF") == 0)
  {
    system("/usr/local/sbin/domotica -a 2");
  }

  else if (strcasecmp(argv[1], "CHON") == 0)
  {
    system("/usr/local/sbin/domotica -e 3");
  }

  else if (strcasecmp(argv[1], "CHOFF") == 0)
  {
    system("/usr/local/sbin/domotica -a 3");
  }

  else if (strcasecmp(argv[1], "CCON") == 0)
  {
    system("/usr/local/sbin/domotica -e 4");
  }

  else if (strcasecmp(argv[1], "CCOFF") == 0)
  {
    system("/usr/local/sbin/domotica -a 4");
  }
  
  else if (strcasecmp(argv[1], "ALLOFF") == 0)
  {
    system("/usr/local/sbin/domotica -X");
  }

  return 0;
}
